#include "interface_io.h"
#include <QCoreApplication>
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusError>
int main( int argc, char* argv[] ) {
    QCoreApplication a( argc, argv );
    Param::readParam();  // 读取参数表
    Param::printParam();

    QDBusConnection connection = QDBusConnection::sessionBus();
    if ( !connection.registerService( "com.lanhai.io" ) ) {
        qDebug() << "error: lanhai.io registerService false:" << connection.lastError().message();
        exit( -1 );
    }
    Interface_IO* object = new Interface_IO();
    if ( !connection.registerObject( "/IO/Interface_IO", object, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals ) ) {
        qDebug() << "error registerObject :" << connection.lastError().message();
        exit( -1 );
    }

    return a.exec();
}
